using System;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SouthernLand.WebMaster.Controls.Contacts
{
    public partial class Contact : UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void btDelete_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow row in GridViewItem.Rows)
            {
                bool isChecked = ((CheckBox) row.FindControl("chkSelect")).Checked;
                if (isChecked)
                {
                    int ContactID = Convert.ToInt32(((CheckBox) row.FindControl("chkSelect")).ToolTip.Trim());
                    Common.BOL.Contact.Contact.Delete(ContactID);
                }
            }
            GridViewItem.DataBind();
        }
    }
}